import { formatDisplayLatLng } from '@/utils/common.js';

const state = {
    center: {
        lat: 25,
        lng: 145
    },
    isMoving: false,
    popupId: null,
}

// getters
const getters = {
    displayedLatlng(state) {
        return formatDisplayLatLng(state.center);
    },
}

// actions
const actions = {

}

// mutations
const mutations = {
    updateMapMoveState(state, value) {
        state.isMoving = value;
    },
    updateMapCenter(state, value) {
        state.center = value;
    },
    setPopupId(state, value) {
        state.popupId = value;
    }
}

export default {
    namespaced: true,
    state,
    getters,
    actions,
    mutations
}